﻿using Model;
using Models;
using Newtonsoft.Json.Linq;
using PublicMethod;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace OrderingOnlineWeChat.Controllers
{
    public class ClassificationController : BaseControl
    {
        // GET: /Classification/
        #region 声明
        ZHHQService.Service1Client server1 = new ZHHQService.Service1Client();
        DCXTService.Service1Client server2 = new DCXTService.Service1Client();
        #endregion        
        
        #region 视图
        public ActionResult Index()
        {
            return View();
         
        }
        public ActionResult Summary()
        {
            return View();

        }
        public ActionResult listProductos()
        {
            return View();

        }
        #endregion

        #region 商品信息
        /// <summary>
        /// 获取商品一二级分类全部信息
        /// </summary>
        /// <returns></returns>
        public ActionResult getType_PC()
        {
            try
            {
                string result = server2.Get_Order_DishesType();
                return Json(result, JsonRequestBehavior.AllowGet);
            }
            catch (Exception) { return null; }
        }

        /// <summary>
        /// 二级菜单已上架的商品列表
        /// </summary>
        /// <param name="DishesTypeID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public ActionResult Get_Order_DishesList(string DishesTypeID, string YZM, int RETID)
        {
            try
            {
                string result = server2.Get_Order_DishesList(DishesTypeID, YZM, RETID);
                return Content(result);
            }
            catch (Exception) { return null; }
        }

        /// <summary>
        /// 商品详情信息
        /// </summary>
        /// <param name="DishesID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public ActionResult Get_Order_DishesByDishesID(string DishesID, string YZM, int RETID)
        {
            try
            {
                string result = server2.Get_Order_DishesByDishesID(DishesID, YZM, RETID);
                return Content(result);
            }
            catch (Exception) { return null; }
        }
        #endregion

    }
}
